package main

import (
	"cqsx/bmi"
	"cqsx/containers"
	"cqsx/database"
	"cqsx/email"
	"cqsx/shuxue"
	"cqsx/student"
	"cqsx/yingyong"
	"fmt"
)

func init() {
	fmt.Println("初始化")

}

func main() {
	for i := 0; i < 3; i++ {
		if database.Login() {
			goto mokuai
		} else {
			fmt.Printf("登录%d次 失败", i+1)
			if i == 2 {
				fmt.Println("您已经尝试3次了，系统为了安全。禁止再次尝试！")
				return
			}
		}
	}
mokuai:
	for i := 0; i < 5; i++ {
		var comand string
		fmt.Println("------------------------------------------------------------------------------------------------------------------------------------------------")
		fmt.Println("------------------------------------------------------------------------------------------------------------------------------------------------")
		fmt.Println("请输入模块的名字")
		fmt.Println("目前仅支持bmi,add,jianfa,chengfa,chufa,arry,slice")
		fmt.Scanln(&comand)
		switch comand {

		case "bmi":
			bmi.BMI()
		case "add":
			shuxue.Add()
		case "jianfa":
			shuxue.Jianfa()
		case "chengfa":
			shuxue.Chengfa()
		case "chufa":
		case "slice":
			containers.InsertStudents()
		case "ticket":
			yingyong.Ticket()
		case "object":
			student.Object()
		case "DBD":
			database.DBDEmo()
		case "jiafen":
			database.Jiafen()
		case "changekey":
			database.ResetPswd()
		case "email":
			email.SendEmail()
		case "save":
			student.SaveStudentRecords()
		case "exit":
			fmt.Println("感谢您的使用")
			break mokuai

		}
	}

}
